var CommentFormValidator = new Class({
    initialize: function(){
        $('id_name').addEvent('blur', function(){            
            var value = this.value;
            if(value == ""){
                alert('Name is empty!!!');
            }
            else{
                alert(value);
            }
        });
        
        $('id_captcha').addEvent('blur', function(){
            var value = this.value;
            if(value == ""){
                alert('You must input CheckCode');            
            }
            else{                
                new XHR({
                    method:'get',
                    async: true,
                    onSuccess: function(text, xml){
                        alert(value + "  " + text);
                    }
                }).send('/blog/ajax/validator', 'form=CommentForm&field=captcha&value=' + value);            
            }
        });
    }
});